package kcms.db;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embeddable;
@Embeddable
public class TeachStudentId  implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String cid;
	private String csn;
	private String cname;
    private String teacher;
    
    public TeachStudentId(){
   	 
    }
    
	public TeachStudentId(String cid,String csn,String cname, String teacher) {
		super();
		this.cname = cname;
		this.teacher = teacher;
		this.cid=cid;
		this.csn=csn;
	}
	@Column(name = "cid", nullable = false)
	public String getCid() {
		return cid;
	}

	public void setCid(String cid) {
		this.cid = cid;
	}
	@Column(name = "csn", nullable = false)
	public String getCsn() {
		return csn;
	}

	public void setCsn(String csn) {
		this.csn = csn;
	}
	@Column(name = "cname", nullable = false)
	public String getCname() {
		return cname;
	}
	public void setCname(String cname) {
		this.cname = cname;
	}
	@Column(name = "teacher", nullable = false)
	public String getTeacher() {
		return teacher;
	}
	public void setTeacher(String teacher) {
		this.teacher = teacher;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof TeachStudentId))
			return false;
		TeachStudentId castOther = (TeachStudentId) other;

		return ((this.getCname() == castOther.getCname()) || (this.getCname() != null
				&& castOther.getCname() != null && this.getCname().equals(
				castOther.getCname())))
				&& ((this.getTeacher() == castOther.getTeacher()) || (this.getTeacher() != null
						&& castOther.getTeacher() != null && this.getTeacher().equals(
						castOther.getTeacher())))
				&& ((this.getCid() == castOther.getCid()) || (this.getCid() != null
						&& castOther.getCid() != null && this.getCid().equals(
						castOther.getCid())))
				&& ((this.getCsn() == castOther.getCsn()) || (this.getCsn() != null
						&& castOther.getCsn() != null && this.getCsn().equals(
						castOther.getCsn())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getCname() == null ? 0 : this.getCname().hashCode());
		result = 37 * result
				+ (getTeacher() == null ? 0 : this.getTeacher().hashCode());
		result = 37 * result
				+ (getCid() == null ? 0 : this.getCid().hashCode());
		result = 37 * result
				+ (getCsn() == null ? 0 : this.getCsn().hashCode());
		return result;
	}


}
